package com.anjubao.parking.municipal.basezone.mapper;

import com.anjubao.parking.municipal.basezone.dto.CitiesResDto;
import com.anjubao.parking.municipal.basezone.dto.DistrictsResDto;
import com.anjubao.parking.municipal.basezone.dto.ProvincesResDto;
import com.anjubao.parking.municipal.basezone.model.BaseZone;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author anjubao
 */
@Mapper
public interface BaseZoneMapper extends BaseMapper<BaseZone> {

    /**
     * 查找所有城市数据
     * @return ProvincesResDto
     */
    public List<ProvincesResDto> findProvinces();

    /**
     * 根据省份ID查找城市数据
     * @param provinceId
     * @return CitiesResDto
     */
    public List<CitiesResDto> findCities(@Param("provinceId") int provinceId);

    /**
     * 根据城市ID查找区域数据
     * @param cityId
     * @return
     */
    public List<DistrictsResDto> findDistricts(@Param("cityId") int cityId);

    /**
     * 还原默认设置
     * @return
     */
    public int updateDefaultCity();

    /**
     * 设置默认城市
     * @param cityId
     * @return
     */
    public int updateDefaultCityByCityId(@Param("cityId") int cityId);

    /**
     * 获取默认城市
     * @return
     */
    public CitiesResDto findDefaultCity();

    /**
     * 获取默认省份
     * @return
     */
    public ProvincesResDto findProvicesByDefaultCity();
}
